package com.dingding.special.order.channel.sql;
/** 
 * @ClassName: TravelOrdersSql 
 * @Description: 旅行社后台-获取订单
 * @author SUNZHICHENG 
 * @date 2016年9月12日 下午7:12:46 
 * 
*/
public class ChannelOrderSql {


	/**
	 * 根据订单id
	 * 查询渠道订单详情
	 */
	public static final String QUERY_TRAVERORDER=" SELECT si.nickName nickName,su.userName driverTel,sv.lisencePlate lisencePlate,sv.vehicleModel vehicleModel,sv.vehicleColor vehicleColor,CASE WHEN uo.totalMoney IS NOT NULL THEN uo.totalMoney ELSE 0.0 END  totalMoney,ul.userName passengerTel,	lc.companyName companyName  FROM UserSpecialOrder uo LEFT JOIN SpecialUserLogin su  ON su.suid = uo.grabOrderUserId LEFT JOIN   SpecialUserInfo si ON   su.suid = si.userId LEFT JOIN   SpecialUserVehicleInfo sv  ON  su.suid=sv. userId LEFT JOIN  LeasingCompanies lc ON sv.lcId = lc.lcId  LEFT JOIN    UserLogin ul ON  ul.uid = uo.placeOrderUserId   WHERE  uo.publishType = 4     AND uo.specialOrderId = ? union SELECT si.nickName nickName,su.userName driverTel,sv.lisencePlate lisencePlate,sv.vehicleModel vehicleModel,sv.vehicleColor vehicleColor,CASE WHEN uo.totalMoney IS NOT NULL THEN uo.totalMoney ELSE 0.0 END  totalMoney,ul.userName passengerTel,	lc.companyName companyName  FROM UserSpecialOrdert uo LEFT JOIN SpecialUserLogin su  ON su.suid = uo.grabOrderUserId LEFT JOIN   SpecialUserInfo si ON   su.suid = si.userId LEFT JOIN   SpecialUserVehicleInfo sv  ON  su.suid=sv. userId LEFT JOIN  LeasingCompanies lc ON sv.lcId = lc.lcId  LEFT JOIN    UserLogin ul ON  ul.uid = uo.placeOrderUserId   WHERE  uo.publishType = 4     AND uo.specialOrderId = ? ";
}
